package com.jcroke.PC32.transformer;

import java.util.Hashtable;
import java.util.LinkedHashMap;

import com.jcroke.PC32.basetransform.DefaultTransformer;
import com.jcroke.PC32.datum.Datum;
import com.jcroke.PC32.datum.dInteger;
import com.jcroke.PC32.datum.dString;

/**
 * 
 * @author jcroke
 * 
 */
public class Int2StringTypeConverter extends DefaultTransformer {
	private final String INTEGER_INPUT = "input2";
	@SuppressWarnings("unused")
	private final String INPUT_1 = "input1"; // Currently not needed (had a
												// vision of universal
												// converter)
	private final String STRING_OUTPUT = "integer2string_out";

	public void execute() {

		LinkedHashMap<String, Datum> inputs = getInput();
		dInteger input = (dInteger) inputs.get(INTEGER_INPUT);
		dString output = new dString(input.toString());

		Hashtable<String, Datum> outputs = new Hashtable<String, Datum>();

		outputs.put(STRING_OUTPUT, output);
		emit(outputs);
	}
}
